package com.zbkj.crmeb.enums;

public enum BusinessTypeEnums {
    PUSH_PRODUCT_PLAT_OF_BY("PUSH_PRODUCT_PLAT_OF_BY","推送商品到别样平台"),
    PUSH_SKU_PLAT_OF_BY("PUSH_SKU_PLAT_OF_BY","推送商品SKU到别样平台"),
    PUSH_PRODUCT_PLAT_OF_BY_9610("PUSH_PRODUCT_PLAT_OF_BY_9610","推送商品到别样平台(9610)"),
    PUSH_SKU_PLAT_OF_BY_9610("PUSH_SKU_PLAT_OF_BY_9610","推送商品SKU到别样平台(9610)"),
    PUSH_PRODUCT_PLAT_OF_DY("PUSH_PRODUCT_PLAT_OF_DY","推送商品到抖音平台"),
    PUSH_SKU_PLAT_OF_DY("PUSH_SKU_PLAT_OF_DY","推送商品SKU到抖音平台"),
    PUSH_PRODUCT_PLAT_OF_DW("PUSH_PRODUCT_PLAT_OF_DW","推送商品到得物平台"),
    PUSH_SKU_PLAT_OF_DW("PUSH_SKU_PLAT_OF_DW","推送商品SKU到得物平台"),
    MAIN_ORDER_OF_SUB_ORDER_RELATION("MAIN_ORDER_OF_SUB_ORDER_RELATION","主单与子单的关系"),
    OTHER_PLAT("OTHER_PLAT","兜底"),
    ;

    private String code;

    private String desc;

    BusinessTypeEnums(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getCodeByPrefix(String prefix) {
        for (BusinessTypeEnums businessTypeEnums : BusinessTypeEnums.values()) {
            if(businessTypeEnums.getCode().endsWith(prefix)){
                return businessTypeEnums.getCode();
            }
        }
        return null;
    }
}
